package FuenteDeDatos;

import java.awt.Color;
import java.awt.Panel;


public class Datahabilitador {

    public void deshabilitar(Panel comp,Object obj){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(false);
        }

        }

    }

     public void habilitar(Panel comp,Object obj){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(true);
        }

        }

    }


       public void deshabilitaredison(org.edisoncor.gui.panel.Panel comp,Object obj){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(false);
        }

        }

    }

     public void habilitaredison(org.edisoncor.gui.panel.Panel  comp,Object obj){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(true);
        }

        }

    }

      public void deshabilitaredisonmultiple(org.edisoncor.gui.panel.Panel comp,Object obj,Object obj2){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(false);

        }else if( comp.getComponent(i).getClass().equals(obj2.getClass())){
            comp.getComponent(i).setEnabled(false);
        }

        }

    }

     public void habilitaredisonmultiple(org.edisoncor.gui.panel.Panel  comp,Object obj, Object obj2){
      int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(true);

        }else if( comp.getComponent(i).getClass().equals(obj2.getClass())){
            comp.getComponent(i).setEnabled(true);
        }

        }

}


     public void cambiarColor(org.edisoncor.gui.panel.PanelImage comp,Object obj, Color col){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setForeground(col);
        }

        }

    }



       public void deshabilitaredisoncurves(Efectos.PanelCurves comp,Object obj){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(false);
        }

        }

    }

     public void habilitaredisoncurves(Efectos.PanelCurves  comp,Object obj){
        int y= comp.getComponentCount();
        for (int i = 0; i < y; i++) {
           if( comp.getComponent(i).getClass().equals(obj.getClass())){
            comp.getComponent(i).setEnabled(true);
        }

        }

    }
     
}
